import React, { useState } from 'react'

function App() {
  // const count = 0
  const [count, setCount] = useState(0)
  function add() {
    setCount(count => count + 1)
    setCount(count => count + 1)
    setCount(count => count + 1)
    setCount(count => count + 1)
    setCount(count => count + 1)
    console.log(count)
    // count++
  }
  return (
    <>
      <button onClick={add}>加1 {count}</button>
    </>
  )
}

export default App
